﻿@using Microsoft.Owin.Security
@using Resource = Resources.Account.Views.Partial.ExternalLoginsList

<h4>@Resource.Alternate_login_method</h4>
<hr />
@{
    var loginProviders = Context.GetOwinContext().Authentication.GetExternalAuthenticationTypes();
    if (!loginProviders.Any())
    {
        <div>
            <p>
                @Resource.External_login_unavailable
            </p>
        </div>
    }
    else
    {
        string action = Model.Action;
        string returnUrl = Model.ReturnUrl;
        using (Html.BeginForm(action, "Account", new { ReturnUrl = returnUrl }))
        {
            @Html.AntiForgeryToken()
            <div id="socialLoginList">
                <p>
                    @foreach (AuthenticationDescription p in loginProviders)
                    {
                        <button type="submit" class="btn btn-default" id="@p.AuthenticationType" name="provider" value="@p.AuthenticationType" title="@string.Format(Resource.External_login_message, p.Caption)">@p.AuthenticationType</button>
                    }
                </p>
            </div>
        }
    }
}
